<?php
$InThreadListPage = true;
if(IsEnableTitleImg()){
?>
<script type="text/javascript">//<![CDATA[
    function RemoveErrorTitleImg(elem, className,parentClassName) {
        if (!elem || !elem.tagName) return false;
        parentClassName = (typeof parentClassName !== 'undefined') ?  parentClassName : 'media-append';
        if (elem.tagName.toLowerCase() == 'img') {
            var pattern = new RegExp('\\b' + className + '\\b','i');
            var patternp = new RegExp('\\b' + parentClassName.replace(/([\-\*\?\.\[\]\(\)])/g,'\\$1') + '\\b','i');
            if (pattern.test(elem.className)) {
                var delele = elem;
                while(!!delele.parentNode){
                    delele = delele.parentNode;
                    if (patternp.test(delele.className)){
                        delele.parentNode.removeChild(delele);
                        break;
                    }
                }
            }
        }
    };

    if (document.addEventListener) {
        document.addEventListener("error", function (e) {
            var ev=e?e:window.event;
            var elem = ev.target;
            RemoveErrorTitleImg(elem,'titleimg','media-append');
        }, true);
    } else {
        document.attachEvent('onerror', function (e) {
            var ev=e?e:window.event;
            var elem = ev.target;
            RemoveErrorTitleImg(elem,'titleimg','media-append');
        });
    }
//]]>
</script>
<?php
    }
?>